# 动态绑定属性和方法
class Student:
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def info(self):
        print(self.name, self.age)


# 动态绑定属性
s1 = Student('YHSimon', 21)
s2 = Student('Simon', 21)
print(id(s1))
print(id(s2))
s1.gender = '女'
print(s1.name, s1.age, s1.gender)
print(s2.name, s2.age)

print('-----------------------')


# 动态绑定方法
def show():
    print('我很show！')


s2.show = show
s2.show()
